home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / prog / pistol.zip / READ.ME < prev    next >
Text File  |  1987-08-20  |  7KB  |  197 lines

  1.    PISTOL - Portably Implemented STack Oriented Language
  2.                  by
  3.              Ernest E. Bergmann
  4.              Physics, Bldg #16
  5.              Lehigh University
  6.             Bethlehem, Pa. 18015
  7.               (215-) 861-3932
  8.  
  9.     PISTOL is being provided  essentially in the public
  10. domain, not because it isn't good, but to promote interest
  11. in "FORTH-like" languages.  It may be reproduced and
  12. distributed for commercial as well as personal use so long
  13. as the copyright notice is included. (Emulating the FORTH
  14. INTEREST GROUP ("FIG"), P.O. Box 1105, San Carlos, Ca. 94070)
  15.  
  16.     The development of PISTOL is based largely upon STOIC
  17. (STack Oriented Incremental Compiler) that was developed by the
  18. MIT and Harvard Bio-engineering Center in 1977.  STOIC is
  19. readily available from the CP/M User's Group as Volume 23A.
  20.  
  21.     PISTOL was developed with a different philosophy,
  22. perhaps, than its predecessors, FORTH and STOIC.  It is my
  23. belief that FORTH-like languages should be available to users
  24. of large mainframe machines as well as mini- and micro- users.
  25. I have concentrated upon the following goals.  User
  26. friendliness, Portability between machines with different word-
  27. lengths and machine instruction sets, and KISS ("Keep it simple
  28. stupid"), free of many of the ideosyncrasies that have
  29. irritated me with FORTH and, to a lesser degree, STOIC.
  30. Lastly, I wanted PISTOL to be as self-contained and complete as
  31. possible (and my endurance!).  Obviously, the result is not as
  32. chintzy about ram and file space as its predecessors.
  33.  
  34.     Before the FORTH enthusiast is discouraged from
  35. examining this language further, I hasten to add that there are
  36. a number of simplifications that I have introduced which might
  37. be worth considering.  I shall now detail some of the ways that
  38. PISTOL differs from classic FORTH.
  39.  
  40.     Following the lead of STOIC, PISTOL supports strings as
  41. a fundamental element of the language.  They are manipulated in
  42. almost the same manner and ease as numbers.  For example, to
  43. define a word, "DEMO", FORTH starts off with:
  44.  
  45.     : DEMO . . .
  46.  
  47. wheras STOIC and PISTOL start off with:
  48.  
  49.     'DEMO : . . .
  50.  
  51. This could be very important if the choice of name is to be
  52. flexible.  How would one write in FORTH the definition for "3"
  53. depending upon whether the constant "FRENCH" were true or not?:
  54.  
  55. FRENCH IF
  56.     'TROIS
  57.     ELSE
  58.     'THREE
  59.     THEN : 3 ;
  60.  
  61.     Again, following the lead of STOIC, we compile
  62. everything into a compile buffer.  Thus there is no interpret
  63. mode as in FORTH.  This change simplifies the language because
  64. we don't have to code two distinct modes and provide two
  65. separate sets of rules.  To illustrate this point:
  66.  
  67. 20 0 DO <whatever> LOOP
  68.  
  69. would work just fine typed in for immediate execution;  it does
  70. NOT have to be embedded in a definition!
  71.  
  72.     We differ from STOIC and early forms of FORTH by
  73. storing the complete name of each definition.  STOIC, for
  74. example, saves only the first five letters (and a letter
  75. count).  This was done because it simplifies coding the
  76. language originally, the variable length of the name might
  77. actually take no more space, and, most importantly, when we use
  78. the dissassembler and the trace features of PISTOL, we see the
  79. full, original names of the words used.
  80.  
  81.     We have "packaged" PISTOL so that the disassembler,
  82. trace, and editor are always resident (they probably could be
  83. removed, but why not enjoy the synergism of the complete
  84. environment at your fingertips!)
  85.  
  86.     The prompt is much more informative than in other
  87. languages.  STOIC started this trend by displaying "nesting
  88. depth" we have continued this trend by displaying the number of
  89. elements on the parameter stack when it is not empty.  The
  90. prompt explicity shows the current number base being used.  If
  91. the nesting depth is not zero, one sees what one is "nested
  92. into".  This information is used also for more viligent syntax
  93. checking.  I have worked with the earlier languages that
  94. fatally "bomb" with such lines as:
  95.  
  96. IF . . ;
  97.  
  98. or
  99.  
  100. DO . . THEN
  101.  
  102.     We have been able to remove the "arbitrary" restriction
  103. that a ": ...;" definition can only be made at level 0.  We can
  104. and do make extensive use of definitions that are nested inside
  105. of conditional expressions or, even, inside of other
  106. definitions!
  107.  
  108.     We do not support "CODE" definitions.  Here are our
  109. justifications:  We wish to guarantee portability of source
  110. code between widely differing machines.  In addition, we wish
  111. to maintain our goal of user friendliness by being able to
  112. disassemble virtually everything.  Obviously we depart from
  113. STOIC particularly on this point, but STOIC is not portable to
  114. non-8080 compatible machines.
  115.  
  116.     Because the primitives of PISTOL are defined in some
  117. high level language, such as PASCAL or C, it is expected that
  118. additional primitives might be added to the "kernel" as the
  119. need arose.  For example, in order to increase the speed of
  120. PISTOL for block move operations in editing we might want to
  121. replace LDDR, a slow, PISTOL language definition.  On a Z80
  122. machine there is an obvious machine hardware instruction that
  123. could be used instead.  One could add this word to the KERNEL
  124. and "generalize" PBASE be replacing:
  125.  
  126. 'LDDR : . . .
  127.  
  128. by
  129.  
  130. 'LDDR DUP FIND IF
  131.         DROP
  132.            ELSE
  133.         : . . .
  134.            THEN
  135.  
  136.     To slightly ameliorate the lack of "CODE" definitions
  137. we have provided an "inline macro" facility.  If one creates a
  138. word definition using:
  139.  
  140. $: . . . ;$
  141.  
  142. instead of:
  143.  
  144. : . . . ;
  145.  
  146. then when the word is invoken the contents of the definition
  147. are compiled into the compile buffer instead of a "call" to the
  148. definition.
  149.  
  150.     A number of conveniences are provided which are not
  151. common to the "competition".  The crude line editor that is
  152. provided with PISTOL can be used in a BASIC-like fashion.
  153. In addition to being able to "LOAD" files, one can "LOAD" the
  154. edit buffer as well, starting at any particular line number.
  155. For example:
  156.  
  157. 'MYWORK.PIS LOAD
  158.  
  159. and
  160.  
  161. 3 LOAD
  162.  
  163.     There are times when it is nice to record the terminal
  164. session.  Instead of using a printer one can create a disk file
  165. that will hold the record:
  166.  
  167. 'XYZ LISTFILE
  168. LIST ON
  169. .
  170. .    <this will be recorded>
  171. .
  172. LIST OFF
  173. .
  174. .    <this will not>
  175. .
  176. LIST ON
  177. .
  178. .    <this will>
  179. etc.
  180. .
  181. .
  182. BYE    <this way of exiting PISTOL will properly close
  183.      all files that are openned for writing>
  184.  
  185.     Undoubtedly, there are other important differences that
  186. I have not discussed;  I hope that you will give PISTOL a try.
  187. I would be most pleased to receive you comments, constructive
  188. criticisms, and questions.
  189.  
  190.  
  191.                     February 27, 1982
  192.                     
  193.                     Ernest E. Bergmann
  194. 
  195. definition.
  196.  
  197.     A number of convenien